﻿using SharpDX;

using System;
using System.Collections.Generic;
using System.Text;

namespace SpaceBattle
{
    class MouseInput
    {
        private List<Vector2> Positions = new List<Vector2>();
        private int MaxPositionsCount = 255;
        public MouseInput(Vector2 mouseOriginalPoint)
        {
            Positions.Add(mouseOriginalPoint);
        }

        public void Update(object sender, SharpDX.RawInput.MouseInputEventArgs args)
        {
            if (Positions.Count > MaxPositionsCount)
                Positions.RemoveAt(0);

            if (args.X != 0 && args.Y != 0)
                Positions.Add(Positions[Positions.Count - 1] + new Vector2(args.X, args.Y));
        }
    }
}
